package com.dxysun.design.iterator;

import java.util.List;

public class ConcreteIterator<E> implements Iterator<E>
{
	private int cursor;
	private List<E> list;
	private E element;

	public ConcreteIterator(List<E> list)
	{
		this.list = list;
	}

	@Override
	public E next()
	{
		System.out.print("当前位置" + cursor + ": ");
		E e = list.get(cursor);
		cursor++;
		return e;
	}

	@Override
	public boolean hasNext()
	{
		return cursor <= list.size() - 1;
	}
}
